//
// Created by Administrator on 2025/9/3.
//

#include <iostream>
#include <set>
#include <vector>

int main()
{
    // define a vector with 20 elements, holding two copies of each number from 0 to 9
    std::vector<int> ivec;
    for (std::vector<int>::size_type i = 0; i != 10; ++i) {
        ivec.push_back(i);
        ivec.push_back(i);
    }  // duplicate copies of each number
    // iset holds unique elements from ivec; miset holds all 20 elements
    std::set<int> iset(ivec.cbegin(), ivec.cend());
    std::multiset<int> miset(ivec.cbegin(), ivec.cend());
    std::cout << ivec.size() << std::endl; // prints 20
    std::cout << iset.size() << std::endl; // prints 10
    std::cout << miset.size() << std::endl; // prints 20
}
